<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="客户应收款" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/css/BillList.css" />
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function doDetail(id){
		var url="/finance/FinanceListForClient.ihtm?client_id="+id;
		showWin(900,600,url);
	}
	function checkDateStr(){
		var endDate=document.getElementById("end_date").value;
		if(endDate==null || endDate==''){
			ShowAlert('提示框','请选择截止日期',200,100);
			return false;
		}else{
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','截止日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','截止日期格式不正确',200,100);
				return false;
			}
		}
		return true;
	}
	function createPageParaStr(){
		var str="search_key="+encodeURIComponent(document.getElementById("search_key").value);
		str=str+"&area_id="+document.getElementById("area_id").value;
		str=str+"&et_id="+document.getElementById("et_id").value;
		str=str+"&el_id="+document.getElementById("el_id").value;
		
		var creType="A";
		if(document.getElementById("cre_type1").checked){
			creType="Y";
		}else if(document.getElementById("cre_type2").checked){
			creType="N";
		}
		str=str+"&cre_type="+creType;
		
		str=str+"&end_date="+encodeURIComponent(document.getElementById("end_date").value);
		str=str+"&ts_id="+document.getElementById("ts_id").value;
		str=str+"&cost="+document.getElementById("cost").value;
		str=str+"&mng_id="+encodeURIComponent(document.getElementById("mng_id").value);
		str=str+"&mng_name="+encodeURIComponent(document.getElementById("mng_name").value);
		return str;
	}
	
	function createProgramParaStr(){
		var str="search_key="+encodeURIComponent(document.getElementById("hid_search_key").value);
		str=str+"&area_id=${areaId}";
		str=str+"&et_id=${etId}";
		str=str+"&el_id=${elId}";
		str=str+"&cre_type=${creType}";
		str=str+"&end_date="+encodeURIComponent(document.getElementById("hid_end_date").value);
		str=str+"&ts_id=${tsId}";
		str=str+"&cost=${cost}";
		str=str+"&mng_id=${mngId}";
		str=str+"&mng_name="+encodeURIComponent(document.getElementById("hid_mng_name").value);
		return str;
	}
	function doSearch(){
		var str;
		if(IsAdvSearch){//高级
			str="search_type=1";
			if(document.getElementById("cb_sk").checked){
				var searchKey=document.getElementById("search_key").value.trim();
				if(searchKey==null || searchKey==""){
					ShowAlert('提示框','请输入客户名称',200,100);
					return;
				}
				str=str+"&cb_sk=1";
			}
			if(document.getElementById("cb_area").checked){
				var areaId=document.getElementById("area_id").value;
				if(areaId==null || areaId=="" || areaId=="0"){
					ShowAlert('提示框','请选择地区',200,100);
					return;
				}
				str=str+"&cb_area=1";
			}
			if(document.getElementById("cb_et").checked){
				var etId=document.getElementById("et_id").value;
				if(etId==null || etId=="" || etId=="0"){
					ShowAlert('提示框','请选择客户类别',200,100);
					return;
				}
				str=str+"&cb_et=1";
			}
			if(document.getElementById("cb_el").checked){
				var elId=document.getElementById("el_id").value;
				if(elId==null || elId=="" || elId=="0"){
					ShowAlert('提示框','请选择客户等级',200,100);
					return;
				}
				str=str+"&cb_el=1";
			}
			if(document.getElementById("cb_cre").checked){
				str=str+"&cb_cre=1";
			}
			if(document.getElementById("cb_bill_date").checked){
				if(checkDateStr()){
					str=str+"&cb_bill_date=1";
				}else{
					return;
				}
			}
			if(document.getElementById("cb_ts").checked){
				var tsId=document.getElementById("ts_id").value;
				if(tsId==null || tsId=="" || tsId=="0"){
					ShowAlert('提示框','请选择帐套',200,100);
					return;
				}
				str=str+"&cb_ts=1";
			}
			if(document.getElementById("cb_mng").checked){
				var mngId=document.getElementById("mng_id").value;
				if(mngId==null || mngId=="" || mngId=="0"){
					ShowAlert('提示框','请选择业务员',200,100);
					return;
				}
				str=str+"&cb_mng=1";
			}
			if(document.getElementById("cb_cost").checked){
				str=str+"&cb_cost=1";
			}
		}else{//快速
			str="search_type=2";
		}
		var paraStr=createPageParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		window.location="/business/ReceivableList.ihtm?"+str;
	}
	function getSearchCondition(){
		var searchType="${searchType}";
		var str="search_type="+searchType;
		if(searchType=="1"){//高级
			<c:if test="${cbSK=='1'}">str=str+"&cb_sk=1";</c:if>
			<c:if test="${cbArea=='1'}">str=str+"&cb_area=1";</c:if>
			<c:if test="${cbEt=='1'}">str=str+"&cb_et=1";</c:if>
			<c:if test="${cbEl=='1'}">str=str+"&cb_el=1";</c:if>
			<c:if test="${cbCre=='1'}">str=str+"&cb_cre=1";</c:if>
			<c:if test="${cbBillDate=='1'}">str=str+"&cb_bill_date=1";</c:if>
			<c:if test="${cbTs=='1'}">str=str+"&cb_ts=1";</c:if>
			<c:if test="${cbCost=='1'}">str=str+"&cb_cost=1";</c:if>
			<c:if test="${cbMng=='1'}">str=str+"&cb_mng=1";</c:if>
		}else{//快速
			
		}
		var paraStr=createProgramParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		return str;
	}
	function doAutoCheck(objId){
		if(document.getElementById(objId).style.visibility!="hidden"){
			document.getElementById(objId).checked=true;
		}
	}
	function doGo(pageIndex){
		var str=getSearchCondition();
		window.location="/business/ReceivableList.ihtm?"+str+"&current_page="+pageIndex;
	}
	
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function DoubleClick(it){
		var ob_arr = document.getElementsByName("query_checkbox");
		var str="";
		if(ob_arr.length>=it.getAttribute("index")){
			str=ob_arr[it.getAttribute("index")-1].value;
		}
		if(str==""){
			return;
		}
		showReceiveBillDialog(str);
	}
	function doDownload(){
		var str=getSearchCondition();
		window.location="/business/ReceivableList.ihtm?content_type=EXCEL&"+str;
	}
	function doCancel(){
		window.close();
	}
	function doInit(){
		//Window_Onload();
		document.getElementById("search_key").focus();
	}
	function checkInput(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function showReceiveBillDialog(clientId){
		var url="/finance/BusinessBillByDateForReceive.ihtm?bill_type=business";
		ShowIframeNoScroll("选择日期起止",url,580,300,"showReceBillCallBack("+clientId+")");
	}
	function showReceBillCallBack(clientId){
		if(popRetVal!=null){
			var url="/finance/ReceiveBillNew.ihtm?data_type=CLIENT&client_id="+clientId+"&start_date="+popRetVal[0]+"&end_date="+popRetVal[1];
			ShowIframe("收款",url,1024,500,"showBillDialogCallBack('REC')",1024,600);
		}
	}
	function showBillDialogCallBack(type){
		if(popRetVal!=null){
			var url="/business/ReceivableList.ihtm?"+getSearchCondition()+"&current_page=${qr.pageIndex}";
			if(popRetVal.indexOf(";")!=-1){
				var arr=popRetVal.split(";");
				if(arr[1]!=null && arr[1]=="Y"){
					url=url+"&print_id="+arr[0]+"&print_bill="+type;
					if(arr[2]!=null){
						url=url+"&print_detail="+arr[2];
					}
				}
			}
			window.location=url;
		}
	}
	function showAdjustBillDialog(clientId){
		var url="/finance/AdjustTypeSelect.ihtm?bill_type=BUSINESS_BILL";
		ShowIframeNoScroll("选择调帐类型",url,240,230,"showAdjustBillDialogExt("+clientId+")");
	}
	function showAdjustBillDialogExt(clientId){
		if(popRetVal!=null){
			var url="/finance/AdjustBillNew.ihtm?data_type=EST&adjust_type="+popRetVal+"&est_id="+clientId;
			ShowIframe("调帐",url,1024,500,"showBillDialogCallBack('ADJ')",1024,600);
		}
	}
	function doSms(estIdStr,estName,cost){
		var url="/sms/SmsSendForm.ihtm?est_id_str="+estIdStr;
		if(cost!=""){
			var content=estName+"：贵司应付款已达"+cost+"元，请安排结账，谢谢！";
			url=url+"&content="+encodeURIComponent(content);
		}
		showWin(900,500,url);
	}
	function doMutiSms(){
		var str=getMutiIds();
		if(str!=""){
			doSms(str,"","");
		}else{
			ShowAlert('提示框','请选择要发短信的客户',200,100);
		}
	}
	function getMutiIds(){
		var ob_arr = document.getElementsByName("query_checkbox");
		var str="";
		for (i=0;i<ob_arr.length;i++){
			if ((ob_arr[i].checked == true)){
				if(str!=""){
					str=str+";";
				}
				str = str+ob_arr[i].value;
			}
		}
		return str;
	}
	function doShow(id){
		var url="/base/EstablishmentEdit.ihtm?id="+id+"&type=CLIENT&alert_type=NONE";
		ShowIframe("客户",url,980,500,"refreshWin()");
	}
	function refreshWin(){
		if(popRetVal!=null){
			window.location.reload(true);
		}
	}
	function doAccountList(id){
		var url="/business/BusinessBillListForAccountForm.ihtm";
		ShowIframeNoScroll("业务对帐",url,340,380,"doAccountListCallBack('"+id+"')");
	}
	function doAccountListCallBack(id){
		if(popRetVal!=null){
			var startDate=popRetVal[0];
			var endDate=popRetVal[1];
			var type=popRetVal[2];
			var includeSub=popRetVal[3];
			var orderBy=popRetVal[4];
			var linkman=popRetVal[5];
			showWin(900,620,'/business/BusinessBillListForAccount.ihtm?client_id='+id+'&start_date='+startDate+'&end_date='+endDate+'&linkman='+linkman+'&type='+type+'&include_sub='+includeSub+'&order_by='+orderBy);
		}
	}
	function doMutiAcc(){
		var str=getMutiIds();
		if(str!=""){
			doAccountList(str);
		}else{
			ShowAlert('提示框','请选择要发对帐的客户',200,100);
		}
	}
	function showSmsSubscribe(){
		<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';SMS_SUBS;')!=-1}">
		showWin(520,640,'/sms/SmsSubscribe.ihtm');
		</c:if>
		<c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';SMS_SUBS;')==-1}">
		ShowAlert('提示框','对不起，您还没有短信订阅设置权限。',200,100);
		</c:if>
	}
	function doBackCostList(id,name){
		//var d=new Date();
		//var startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-01";
		//var endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		var url="/finance/BackCostList.ihtm?est_id="+id+"&est_name="+encodeURIComponent(name)+"&cb_est=1&search_type=1";
		showWin(1024,600,url);
	}
	function doPrintCallBack(){
		var printId="${printId}";
		var printBill="${printBill}";
		var printDetail="${printDetail}";
		if(printId!=null && printId!=""){
			if(printBill=="REC"){
				showWin(900,600,"/finance/ReceiveBillPrint.ihtm?id="+printId+"&print_detail="+printDetail);
			}else if(printBill=="ADJ"){
				showWin(900,600,"/finance/AdjustBillPrint.ihtm?id="+printId);
			}
		}
	}
	function selectStaffer(){
		var url="/base/StafferMainForSelect.ihtm";
		var cb="selectStafferCallBack()";
		ShowIframe("选择员工",url,800,500,cb);
	}
	function selectStafferCallBack(){
		if(popRetVal!=null){
			var arr=popRetVal.split(";");
			document.getElementById("mng_id").value=arr[0];
			document.getElementById("mng_name").value=arr[1];
			doAutoCheck("cb_mng");
		}
	}
</script>
</head>
<c:set var="smsFlag" value="0" />
<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';SMS_SEND_SIMP;')!=-1}"><c:set var="smsFlag" value="1" /></c:if>
<body oncontextmenu="return false">
<div class="Wrap"><!-- 页面主框架 -->
    
	<div id="ListContainer" class="Container"><!-- 主体容器 -->
	    
	    <!-- 标题栏 -->
	    <div class="Heading BillIcon">
	        <div class="HeadingContent">
	            <h1>客户应收款</h1>
	            <span class="Note">管理所有欠款客户，可以进行收款、调账以及对账等操作</span>
	        </div>
	    </div>
	
		<!-- 主内容 -->
		<div class="Content">
	        <!-- 筛选控件栏 -->
	        <div class="FilterBar ClearFix">
	            <div class="SearchIcon"></div>
	            <span class="fl">
	            	<table class="MoreOption" cellpadding="0" cellspacing="0">
	            		<th class="c1" width="80px">
	            			<input type="checkbox" name="cb_sk" id="cb_sk" <c:if test="${cbSK=='1' || searchType=='2'}">checked="true"</c:if> style="visibility:hidden;" />
	            			客户名称
	            		</th>
	            		<td class="c3" width="260px">
	            			<input type="text" class="TextBox" id="search_key" name="search_key" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_sk');" value="<c:out value="${searchKey}" />" title="以客户名称、客户拼音字头进行模糊查询">
							<input type="hidden" id="hid_search_key" value="<c:out value="${searchKey}" />">
	            		</td>
	            	</table>
	            </span>
	            <span class="fr">
	            	<a href="javascript:;" id="lnkMoreOption">更多查询选项</a>
	            	<!-- <a href="javascript:showSmsSubscribe();" style="color:green" title="设置应收款超过信用额度的客户，系统自动发送催款结账的短信。">手机提醒设置</a> -->
		  			<input type="button" value=" 查 询" onClick="doSearch();" class="buttom search-but">
		  			<input type="button" value=" 对 帐" onClick="doMutiAcc();" class="buttom search-print">
		  			<input type="button" value=" 导 出" onClick="doDownload();" class="buttom search-out" <c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_EXPO;')!=-1}">disabled="true"</c:if>>
					<input type="button" value=" 短 信" onClick="doMutiSms();" class="buttom search-sms" <c:if test="${smsFlag!='1'}">disabled="true"</c:if>>
	            </span>
				<div id="dvMoreOptionBox" class="MoreOptionBox" style="display:none;">
					<table class="MoreOption" cellpadding="0" cellspacing="0">
						<tr>
							<th class="c1" width="80px">
			        			<input type="checkbox" name="cb_cre" id="cb_cre" <c:if test="${cbCre=='1'}">checked="true"</c:if>>
			        			信用额度
			        		</th>
			        		<td class="c3" width="180px">
			        			<input type="radio" name="cre_type" id="cre_type1" onClick="doAutoCheck('cb_cre');" <c:if test="${creType=='Y'}">checked="true"</c:if> >已超出
								<input type="radio" name="cre_type" id="cre_type2" onClick="doAutoCheck('cb_cre');" <c:if test="${creType=='N'}">checked="true"</c:if> >未超出
								<input type="radio" name="cre_type" id="cre_type3" onClick="doAutoCheck('cb_cre');" <c:if test="${creType==null || creType=='' || creType=='A'}">checked="true"</c:if> >全部
			    			</td>
			    			<th class="c2" width="80px">
			        			<input type="checkbox" name="cb_et" id="cb_et" <c:if test="${cbEt=='1'}">checked="true"</c:if>>
			        			客户类别
			        		</th>
			        		<td class="c3" width="280px">
			        			<select name="et_id" id="et_id" onFocus="doAutoCheck('cb_et');">
							  		<option value="0">==请选择==</option>
							  		<c:forEach var="item" items="${estTypeList}">
							  		<option value="${item.id}" <c:if test="${etId==item.id}">selected</c:if>>${item.typeName}</option>
							  		</c:forEach>
						  		</select>
			    			</td>
			    		</tr>
			    		<tr>
							<th class="c1">
			        			<input name="" type="checkbox" name="cb_bill_date" id="cb_bill_date" <c:if test="${cbBillDate=='1'}">checked="true"</c:if>>
			        			截止日期
			        		</th>
			        		<td>
			        			<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_bill_date');" id="end_date" name="end_date" value="<c:out value="${endDate}" />" >
								<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('end_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_bill_date\')');">
								<input type="hidden" id="hid_end_date" value="<c:out value="${endDate}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_el" id="cb_el" <c:if test="${cbEl=='1'}">checked="true"</c:if>>
			        			客户等级
			        		</th>
			        		<td class="c3">
			        			<select name="el_id" id="el_id" onFocus="doAutoCheck('cb_el');">
							  		<option value="0">==请选择==</option>
							  		<c:forEach var="item" items="${estLevelList}">
							  		<option value="${item.id}" <c:if test="${elId==item.id}">selected</c:if>>${item.levelName}</option>
							  		</c:forEach>
						  		</select>
			    			</td>
			    		</tr>
			    		<tr>
							<th class="c1">
			        			<input type="checkbox" name="cb_cost" id="cb_cost" <c:if test="${cbCost=='1'}">checked="true"</c:if>>
			        			欠款金额
			        		</th>
			        		<td class="c3">
			        			<select name="cost" id="cost" onFocus="doAutoCheck('cb_cost');">
							  		<option value="NOT_ZERO" <c:if test="${cost=='NOT_ZERO'}">selected</c:if>>不为0</option>
							  		<option value="ZERO" <c:if test="${cost=='ZERO'}">selected</c:if>>等于0</option>
						  		</select>
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_area" id="cb_area" <c:if test="${cbArea=='1'}">checked="true"</c:if>>
			        			地区
			        		</th>
			        		<td class="c3">
			        			<select name="area_id" id="area_id" onFocus="doAutoCheck('cb_area');">
									<option value="0">==全部地区==</option>
									<commonTag:createSelectTree list="${areaList}" emptyOption="0" justEnabled="1" defaultValue="${areaId}" />
								</select>
			    			</td>
			    		</tr>
			    		<tr>
							<th class="c1">
			        			<input type="checkbox" name="cb_ts" id="cb_ts" <c:if test="${cbTs=='1'}">checked="true"</c:if>>
			        			账套
			        		</th>
			        		<td class="c3">
			        			<select name="ts_id" id="ts_id" onFocus="doAutoCheck('cb_ts');">
					  				<option value="0">==请选择账套==</option>
					  				<c:forEach var="item" items="${tsList}">
					  				<option value="${item.id}" <c:if test="${tsId==item.id}">selected</c:if>>${item.title}</option>
					  				</c:forEach>
				  				</select>
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_mng" id="cb_mng" <c:if test="${cbMng=='1'}">checked="true"</c:if>>
			        			业务员
			        		</th>
			        		<td class="c3">
			        			<input type="text" class="TextBox readonly" readonly="readonly" maxlength="50" name="mng_name" id="mng_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_mng');" value="<c:out value="${mngName}" />" >
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectStaffer();" />
								<input type="hidden" id="mng_id" value="<c:out value="${mngId}" />">
								<input type="hidden" id="hid_mng_name" value="<c:out value="${mngName}" />">
			    			</td>
			    		</tr>
					</table>
			    	
					<div class="OptionOrderBy">
	                    <span class="fr"><a href="javascript:;" id="lnkHiddenOption">隐藏查询选项</a></span>
	                </div>
				</div>
			</div>
			
			<!-- 提示信息显示栏 -->
	        <div class="MsgBar">
	            <%@include file="../inc/AlertMsg.jsp"%>
	        </div>
	        
	        <!-- 上栏 分页、操作等 -->
			<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';NO_TOTA;')==-1}">
	        <div class="TopToolBar">
	            <table class="ListNoteInfo" cellpadding="0" cellspacing="0">
	            	<tr>
	                	<td>欠款合计：${remCost}元</td>
	            	</tr>
	            </table>
			</div>
			</c:if>
			
		    <div class="table-list">
		        <table width="100%">
					<tr>
						<th width="14"><input type="checkbox" onClick="javascript:checkall(this);"></th>
						<th width="8%">客户编号</th>
						<th width="13%">客户名称</td>
						<th width="10%">合同金额</th>
						<th width="10%">已收金额</th>
						<th width="8%">调账金额</th>
						<th width="10%">尚欠金额</th>
						<th width="10%">信用额度</th>
						<th width="8%">最近交易</th>
						<th width="10%">客户备注</th>
						<th width="13%">操作</th>
					</tr>
					<c:forEach var="item" items="${qr.list}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<c:set var="defaultFontColor" value="#000000" />
					<c:if test="${item[9]=='N'}"><c:set var="defaultFontColor" value="red" /></c:if>
					<tr class="${trClass}" index="${i.index+1}" style="color:${defaultFontColor};cursor:pointer;" defaultFontColor="${defaultFontColor}" ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this,true)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
						<td><input type="checkbox" onClick="javascript:ClickCheck(this,true);" name='query_checkbox' value="${item[0]}"></td>	
						<td>${item[1]}</td>
						<td>${item[2]}</td>
						<td>${item[4]}</td>
						<td>${item[6]}</td>
						<td>${item[5]}</td>
						<td>${item[7]}</td>
						<td>${item[3]}</td>
						<td><c:if test="${item[8]!=null}"><fmt:formatDate value="${item[8]}" pattern="yyyy-MM-dd"/></c:if></td>
						<td>${item[10]}</td>
						<td style="text-align:left">
							<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';RECE_BILL;')!=-1}"><a href="#" onClick="showReceiveBillDialog('${item[0]}');"></c:if>收款<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';RECE_BILL;')!=-1}"></a></c:if>
							<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';ADJU_BILL;')!=-1}"><a href="#" onClick="showAdjustBillDialog('${item[0]}');"></c:if>调账<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';ADJU_BILL;')!=-1}"></a></c:if>
							<!--<a href="javascript:doDetail('${item[0]}');">查明细</a>-->
							<c:if test="${smsFlag=='1'}"><a href="javascript:doSms('${item[0]}','<c:out value="${item[2]}" />','${item[7]}');"></c:if>发短信<c:if test="${smsFlag=='1'}"></a></c:if>
							<br>
							<a href="javascript:doShow('${item[0]}');">查看</a>
							<a href="javascript:doAccountList('${item[0]}');">对帐</a>
							<a href="javascript:doBackCostList('${item[0]}','${item[2]}');">回款记录</a>
						</td>
					</tr>
					</c:forEach>
				</table>
			</div>
			
			<!-- 底栏 分页、操作等 -->
	        <div class="BottomToolBar ClearFix">
			    <%@include file="../inc/Pages.jsp"%>
	        </div>
			
		</div>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
	function ChangeWindowSize( container, maxWidth ){
	    setTimeout( function(){
	        var w1 = document.documentElement.clientWidth-40;
	        if( w1>maxWidth ) w1 = maxWidth;
	        else if( w1<870 ) w1 = 860;
	        container.style.width = w1+'px';
	    }, 300 );
	}
	var IsAdvSearch = false;
	(function(){
		doInit();
		doPrintCallBack();
	    var ListContainer = document.getElementById('ListContainer');
	    ChangeWindowSize( ListContainer, 2020 );    // 超过 1280 的最大 1260 ，不全部铺满
	
	    var lnkMoreOption   = document.getElementById('lnkMoreOption');
	    var lnkHiddenOption = document.getElementById('lnkHiddenOption');
	    lnkMoreOption.onclick = function(){
	    	IsAdvSearch = true;
	        document.getElementById('dvMoreOptionBox').style.display = 'block';
	        document.getElementById('cb_sk').style.visibility = 'visible';
	        this.style.visibility = 'hidden';
	    };
	    lnkHiddenOption.onclick = function(){
	    	IsAdvSearch = false;
	        document.getElementById('dvMoreOptionBox').style.display = 'none';
	        document.getElementById('cb_sk').style.visibility = 'hidden';
	        lnkMoreOption.style.visibility = 'visible';
	    };
	})();
</script>
